﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NeuralNetworks.ActivationFunctions
{
    class ThresholdFunction : IActivationFunction
    {
        //double threshold;
        //bool bipolar = false;
        private double p;

        public ThresholdFunction(double p)
        {
            this.p = p;
        }

        public double Compute(double x)
        {
            if (x < p) return 0;
            return 1;
        }

        public double ComputeDifferential(double x)
        {
            return 0;
        }

        public override string ToString()
        {
            return ActivationFunctionFactory.threshold;
        }
    }
}
